<template>
    <div>
        <van-cell :title="item.goods_name" :label="item.total_num+item.goods_unit" v-for="(item,index) of list" :key="index">
            <template #right-icon>
                <van-button class="btn" type="primary" round size="small" @click="$router.push({path:'/goodInfo',query:{id:item.goods_id}})">再次订购</van-button>
            </template>
        </van-cell>
    </div>
</template>
<script>
import {OrderStatistics} from '../ajax'
export default {
    data() {
        return {
            list:[]
        }
    },
    created(){
        this.getOrderStatistics();
    },
    methods:{
        getOrderStatistics(){
            const data = {group_id:this.$store.getters.wxUserInfo.group_id}
            OrderStatistics(data).then(res=>{
                // console.log(res);
                this.list = res;
            })
        }
    }
}
</script>
<style lang="scss" scoped>
    .btn{
        line-height: 1.7rem;
        height: 1.7rem; 
        font-size: 0.6rem;
    }
</style>